| Conditions | 3 |
| Paths | 3 |
| Total Lines | 41 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | define(['leaflet', 'helper'], |
||
| 15 | createTile: function (tilePoint) { |
||
| 16 | var tile = L.DomUtil.create('canvas', 'leaflet-tile'); |
||
| 17 | |||
| 18 | var tileSize = this.options.tileSize; |
||
| 19 | tile.width = tileSize; |
||
| 20 | tile.height = tileSize; |
||
| 21 | |||
| 22 | if (!this.data) { |
||
| 23 | return tile; |
||
| 24 | } |
||
| 25 | |||
| 26 | var ctx = tile.getContext('2d'); |
||
| 27 | var s = tilePoint.multiplyBy(tileSize); |
||
| 28 | var map = this._map; |
||
| 29 | |||
| 30 | var margin = 50; |
||
| 31 | var bbox = helper.getTileBBox(s, map, tileSize, margin); |
||
| 32 | |||
| 33 | var nodes = this.data.search(bbox); |
||
| 34 | |||
| 35 | if (nodes.length === 0) { |
||
| 36 | return tile; |
||
| 37 | } |
||
| 38 | |||
| 39 | var startDistance = 12; |
||
| 40 | |||
| 41 | ctx.beginPath(); |
||
| 42 | nodes.forEach(function (d) { |
||
| 43 | var p = map.project([d.node.nodeinfo.location.latitude, d.node.nodeinfo.location.longitude]); |
||
| 44 | |||
| 45 | p.x -= s.x; |
||
| 46 | p.y -= s.y; |
||
| 47 | |||
| 48 | helper.positionClients(ctx, p, d.startAngle, d.node.statistics.clients, startDistance); |
||
| 49 | }); |
||
| 50 | |||
| 51 | ctx.fillStyle = 'rgba(220, 0, 103, 0.7)'; |
||
| 52 | ctx.fill(); |
||
| 53 | |||
| 54 | return tile; |
||
| 55 | } |
||
| 56 | }); |
||
| 58 |